home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2741 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.1 KB

  1. Path: classic.iinet.com.au!news
  2. From: ng@mitswa.com.au (John A Ng)
  3. Newsgroups: comp.lang.c++,comp.lang.c
  4. Subject: Re: Performance: C vs. C++
  5. Date: Fri, 19 Jan 1996 09:52:50 GMT
  6. Organization: MITS (WA)
  7. Message-ID: <4dnpl2$c8g@classic.iinet.com.au>
  8. References: <30F6BAAC.12B5@iastate.edu> <4da9pn$a45@news.bridge.net>
  9. NNTP-Posting-Host: grunge163.nv.iinet.net.au
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. David Byrden <100101.2547@compuserve.com> wrote:
  13.  
  14.  
  15. >Steve;
  16.  
  17. >C and C++ are so similar that I would expect similar code to produce 
  18. >almost identical performance. However, note that while virtual functions 
  19. >cause overhead when you use them, exceptions in most present compilers can 
  20. >cause overhead *at every function call*.
  21.  
  22. >   David
  23.  
  24.  
  25. Not quite.  C is quite different from C++ from the performance point of
  26. view.  The difference is not only in virtual functions and exceptions
  27. but in class construction, destruction, etc... and most significantly in
  28. Runtime Type Checking.  However, because machines are getting faster by
  29. the day, this sort of "inefficiency" is hardly noticable.
  30. Regards,
  31.  
  32. John Ng
  33. ng@mitswa.com.au
  34. Western Australia
  35.  
  36.